package com.example.forum.dao;

import com.example.forum.model.Message;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MessageMapper {
    int insert(Message record);

    int insertSelective(Message record);

    Message selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Message record);

    int updateByPrimaryKey(Message record);

    Integer selectUnreadCount (Long userId);

    /**
     * 根据接收者Id查询所有私信
     * @param receiveUserId 接收者id
     * @return 私信列表
     */
    List<Message> selectByReceiveUserId (@Param("receiveUserId") Long receiveUserId);

}